<!--
@description: 省市区组件测试
@author: ldb
@time: 2022-09-25 15:26:53
-->
<template>
  {{ value }}
  <Area ref="area" v-model:value="value" :action="getArea" :params="params" :type-value="typeValue" />
</template>

<script lang="ts" setup>
import Area, { AreaTypeValue } from './area'
import { ref } from 'vue'
import { getArea } from '@/api/system/area'
import { SelectParams } from '@/components/base/form-item/props/form-item-params'
const params: SelectParams = {
  notFoundContent: '暂无数据',
  showSearch: false,
  fieldNames: {
    label: 'name',
    value: 'name',
  },
}
const typeValue: AreaTypeValue = {
  firstParams: {
    level: 'province',
  },
  parentKey: 'id',
  childrenKey: 'parentId',
}
const value = ref<Array<string>>(['', '', ''])
</script>

<style scoped lang="scss"></style>
